function FileServer() {
    // return 'https://xcx.wto163.cn/';
    // return 'http://xyj.local/';
    return 'http://sangushui.lmweixin.com/';
}

function HttpGet(url, cb, isAsync) {
    let isasyc = (isAsync == undefined || isAsync == true);
    url = prepUrl(url);
    $.ajax({
        url: url,
        method: "get",
        async: isasyc,//默认true
        dataType: "json",
        success: function (e) {
            if (ReqBackInject(e)) {

                cb && cb(e);
            }
        }
    });
}

function HttpPost(url, data, cb) {
    url = prepUrl(url);
    $.ajax({
        url: url,
        method: "post",
        data: data,
        dataType: "json",
        //contentType: "application/json", 
        success: function (e) {
            if (ReqBackInject(e)) {
                cb && cb(e);
            }
        }
    })
}


function ReqBackInject(e) {

    return true;
}

function prepUrl(url) {
    url = url.trim();
    if (url[0] != '/') {
        url = '/' + url;
    }
    if (url.indexOf('?') == -1) {
        url += '?';
    }
    return FileServer() + url;
}


